/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.webhomesites.configuracao.infra;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.AnnotationConfiguration;

/**
 *
 * @author Webhome
 */
public class CriadorSession {
    
    public static Session getSession() {
        
        AnnotationConfiguration configuration = new AnnotationConfiguration();
        configuration.configure();
        SessionFactory factory = configuration.buildSessionFactory();
        Session session = factory.getCurrentSession();
        return session;
        
    }
    
}
